function make_pst()

global VOLTAGE

DFILE = datac('getdfile');

% make a psth from the data that is currently loaded
%
binwms = 5;

time=make_time(DFILE);
tmax=max(max(time));
RATES = DFILE.rate * DFILE.nr_channel / 1000; % array of sampling rates, convert to msec

spike_thresh = 0;

QueMessage('STA - Finding spikes');
[first_spike, first_isi, nr_spikes, spike_train]=find_spikes(DFILE, 0, tmax, spike_thresh);
[first_spike1, first_isi1, nr_spikes1, spike_train1]=find_spikes(DFILE, 200, tmax, spike_thresh);
QueMessage(sprintf('STA - found %4d spikes', sum(nr_spikes)));
fsl1 = find(~isnan(first_spike1));
first_spike1 = first_spike1(fsl1);
hf = findobj('tag', 'fig_psth');
if(isempty(hf))
   figure('tag', 'fig_psth');
end;
hf = findobj('tag', 'fig_psth');

n = length(spike_train);
alllat = [];
for i = 1:n
   alllat = [alllat spike_train(i).latency];
end;
maxlat = max(alllat); % max latency.
maxt = ceil(maxlat); % max time, in rounded msec.
nbins = maxt/binwms;
figure(hf);
subplot('Position', [0.1, 0.5, 0.8, 0.4]);
hist(alllat, nbins);
set(gca, 'XLim', [0, maxt]);
first_spike1

subplot('Position', [0.1 0.1 0.8 0.3]);
maxfsl = ceil(max(first_spike1));
nfslb = maxfsl/binwms;

hist(first_spike1, nfslb);
set(gca, 'XLim', [0, maxfsl]);

